home *** CD-ROM | disk | FTP | other *** search
- --Note: This is called from a score script in "starfest0.dir," the projector, because
- -- it needs to execute after the sound has started, so the user doesn't
- -- think that nothing is happening. It is called from handler "sharedstartMovie."
- on initFieldNotes
- global gFieldNoteList
-
- preLoadMember member "01 text" of castLib "shared", member "19 text" of castLib "shared"
- set gFieldNoteList = []
- set saveDelim = the itemDelimiter
- set the itemDelimiter = "*"
- repeat with i = 1 to 19
- if (i < 10) then
- set aName = "0" & i & " text"
- else
- set aName = i & " text"
- end if
- set myLineHeight = the lineHeight of field aName
- set theText = the text of field aName
- set nItems = the number of items in theText
- set oldCharPos = -100 -- Don't want 0, cause it will make one of the following tests fail
- set thisList = []
- repeat with j = 2 to nItems
- if (j = 2) then
- set myChar = 1
- else if (j = 3) then
- set myChar = length(item 2 of theText) + 2
- else
- set myChar = length(item 2 to (j-1) of theText) + 2
- end if
- set myCharPos = (the locV of charPosToLoc(member aName of castLib "shared", myChar))
- if (myCharPos <> oldCharPos + myLineHeight) then
- set scrollPixel = myCharPos - myLineHeight + 1
- end if
- set myWord = line 1 of (item j of theText)
- set the itemDelimiter = ":"
- set myWord = item 1 of myWord
- set the itemDelimiter = "*"
- addAt(thisList,j,[myWord,myChar,scrollPixel])
- set oldCharPos = myCharPos
- end repeat
- if ( count(thisList) > 0 ) then
- deleteAt(thisList,1)
- end if
- addAt(gFieldNoteList,i,thisList)
- end repeat
- set the itemDelimiter = saveDelim
-
- end initFieldNotes
-
-
- on getScrollPixel aSite,aPhrase
- global gFieldNoteList
-
- set retVal = -1
- set thisSitesList = getAt(gFieldNoteList,aSite)
- repeat with i = 1 to count(thisSitesList)
- set phraseDataList = getAt(thisSitesList,i)
- set cmpWord = getAt(phraseDataList,1)
- if (cmpWord contains aPhrase) then
- set retVal = getAt(phraseDataList,3)
- exit repeat
- end if
- end repeat
- if (retVal = -1) then
- put "Field Note Error: Couldn't find search word |" & aPhrase & "| in site " & aSite
- set retVal = 0
- end if
- return (retVal)
- end getScrollPixel
-
-
- on findScroll
- global gSearchTextCast, gFindText
-
- if (not (objectP(gSearchTextCast))) then
- set gSearchTextCast = member (chars(the movieName,1,2) && "TEXT") of castLib "Shared"
- end if
-
- set mySite = the memberNum of gSearchTextCast - 440
- set myPix = getScrollPixel(mySite,gFindText)
- set the scrollTop of member gSearchTextCast of castLib "Shared" = myPix
-
- set gSearchTextCast = EMPTY
- set gFindText = EMPTY
- end findScroll